import request from 'lib/request';

// 获取好友申请列表
export function requestRelation(hospitalId, patientId) {
  let body = {
    hospitalId,
    patientId,
  }
  return request("wechat/patient/relation/request?"+"hospitalId="+hospitalId+"&patientId="+patientId,{
    method: "GET",
  })
}

// 接受好友申请
export function acceptRelation(id) {
  const body = new FormData();
  body.append('id', id);
  body.append('status', 1);
  return request.post('wechat/patient/relation/accept', { body });
}

// 患者加医生好友
export function sendRelation(doctorId, patientId) {
  const body = new FormData();
  body.append('doctorId', doctorId);
  body.append('patientId', patientId);
  return request.post('wechat/patient/relation/send', { body });
}

// 生成患者二维码
export function generateQrcode() {
  const body = new FormData();
  return request.post('wechat/patient/relation/qrcode', { body });
}
